import { ViewProps } from "@tarojs/components";
import { PropsWithChildren } from "react";
import { WrappingText } from "@/components";
import "./index.scss";

interface ParagraphProps extends ViewProps {
  size?: "default" | "small";
  noSpacing?: boolean;
  color?: string;
}

const Paragraph = ({
  size = "default",
  color,
  noSpacing = false,
  className,
  children,
  ...props
}: PropsWithChildren<ParagraphProps>) => {
  return (
    <WrappingText
      className={`
    ${className ?? ""} 
    paragraph
    size-${size}
    ${noSpacing ? "no-spacing" : ""}
    `}
      color={color}
      {...props}
    >
      {children}
    </WrappingText>
  );
};

export default Paragraph;
